
HEADERS = OSAL.h OSAL_config.h OSAL_types.h OSAL_internal.h OSAL_crypt.h OSAL_telnet.h

OBJECTS = OSAL_fsm.o OSAL_mi.o OSAL_timer.o OSAL_array.o OSAL_hash.o OSAL_list.o OSAL_trace.o 
OBJECTS += OSAL_mem.o OSAL_semaphore.o OSAL_pthread.o OSAL_ringBuffer.o OSAL_rid.o OSAL_utilFunc.o 
OBJECTS += OSAL_crypt.o OSAL_telnet.o


MI_DEPs       = OSAL_mi.c OSAL_mi.h
RA_DEPs       = OSAL_array.c OSAL_array.h
FSM_DEPs      = OSAL_fsm.c OSAL_fsm.h
MEM_DEPs      = OSAL_mem.c OSAL_mem.h
SEM_DEPs      = OSAL_semaphore.c OSAL_semaphore.h
RID_DEPs      = OSAL_rid.c OSAL_rid.h
HASH_DEPs     = OSAL_hash.c OSAL_hash.h
RLIST_DEPs    = OSAL_list.c OSAL_list.h
TIMER_DEPs    = OSAL_timer.c OSAL_timer.h
TRACE_DEPs    = OSAL_trace.c OSAL_trace.h
TELNET_DEPs   = OSAL_telnet.c OSAL_telnet.h
PTHREAD_DEPs  = OSAL_pthread.c OSAL_pthread.h
RINGBUF_DEPs  = OSAL_ringBuffer.c OSAL_ringBuffer.h
UTILFUNC_DEPs = OSAL_utilFunc.c OSAL_utilFunc.h


CC    = g++
FLAGS = -Wall -g -O2 -c


TARGET = OSAL


$(TARGET):$(OBJECTS)
	$(LD) -r -o $(TARGET) $(OBJECTS)


OSAL_fsm.o: $(FSM_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_fsm.c

OSAL_timer.o: $(TIMER_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_timer.c

OSAL_mi.o: $(MI_DEPs)  $(HEADERS)
	$(CC) $(FLAGS) OSAL_mi.c

OSAL_array.o: $(RA_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_array.c

OSAL_list.o: $(RLIST_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_list.c

OSAL_hash.o: $(HASH_DEPs)  $(HEADERS)
	$(CC) $(FLAGS) OSAL_hash.c

OSAL_mem.o: $(MEM_DEPs)  $(HEADERS)
	$(CC) $(FLAGS) OSAL_mem.c

OSAL_trace.o: $(TRACE_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_trace.c

OSAL_semaphore.o: $(SEM_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_semaphore.c

OSAL_pthread.o: $(PTHREAD_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_pthread.c

OSAL_ringBuffer.o: $(RINGBUF_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_ringBuffer.c

OSAL_rid.o: $(RID_DEPs)	$(HEADERS)
	$(CC) $(FLAGS) OSAL_rid.c

OSAL_utilFunc.o: $(UTILFUNC_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_utilFunc.c

OSAL_crypt.o: $(HEADERS)
	$(CC) $(FLAGS) OSAL_crypt.c

OSAL_snmp.o: $(HEADERS)
	$(CC) $(FLAGS) OSAL_snmp.c

OSAL_snmpEncode.o: $(HEADERS)
	$(CC) $(FLAGS) OSAL_snmpEncode.c

OSAL_snmpDecode.o: $(HEADERS)
	$(CC) $(FLAGS) OSAL_snmpDecode.c

OSAL_telnet.o: $(TELNET_DEPs) $(HEADERS)
	$(CC) $(FLAGS) OSAL_telnet.c


clean:
	@rm -f $(OBJECTS) $(TARGET)
